﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Unity.Logic.Expressions.statements
{
    public enum ERelationType : byte
    {
        NOT,
        AND,
        OR,
        EQV,
        NEQV,
        NA
    }
    public enum EStatementType : byte
    {
        EQUAL,
        UNEQUAL,
        GREATER,
        LESS,
        GREATEREQUAL,
        LESSEQUAL,
        NA
    }

    public class TStatementBase
    {
        #region ctors
        public TStatementBase(EStatementType statementType)
        {
            _StatementType = statementType;
        }
        #endregion

        #region static ctor
        static TStatementBase()
        {
            _StatementsDict = new Dictionary<EStatementType, string>()
            {
                {EStatementType.EQUAL, "="},
                {EStatementType.UNEQUAL, "<>"},
                {EStatementType.GREATER, ">"},
                {EStatementType.LESS, "<"},
                {EStatementType.GREATEREQUAL, ">="},
                {EStatementType.LESSEQUAL, "<="},
            };
            _RelationsDict = new Dictionary<ERelationType, string>()
            {
                {ERelationType.NOT, "NOT"},
                {ERelationType.AND, "AND"},
                {ERelationType.OR, "OR"},
                {ERelationType.EQV, "EQV"},
                {ERelationType.NEQV, "NEQV"},
            };
        }
        #endregion

        #region properties
        private EStatementType _StatementType;
        protected EStatementType StatementType
        {
            get { return _StatementType; }
            set { _StatementType = value; }
        }

        public string StatementMark
        {
            get { return _StatementsDict[_StatementType]; }
            //set { _StatementMark = value; }
        }

        private static Dictionary<EStatementType, string> _StatementsDict;

        private static Dictionary<ERelationType, string> _RelationsDict;
        public static Dictionary<ERelationType, string> RelationsDict
        {
            get { return TStatementBase._RelationsDict; }
            set { TStatementBase._RelationsDict = value; }
        }
        #endregion
    }
}
